<?php
class Mod_chuyenkhoa extends CI_Controller{
    function  __construct(){
        parent::__construct();
        //$this->load->model('mod_chuyenkhoa/mmod_chuyenkhoa');
    }
    function index($param = ''){
        $data['chuyenkhoa'] = $this->home_model->get_data('chuyenkhoa','',array('truong'=>'order','sapxep'=>'asc'));
        $this->load->view('mod_chuyenkhoa/vmod_chuyenkhoa',$data);
    }
    function danhsachbenh(){
        $idchuyenkhoa = $this->uri->segment(3,0);
        $data['chuyenkhoa'] = $this->home_model->get_data('chuyenkhoa',array('id'=>$idchuyenkhoa));
        $data['danhsachbenh'] = $this->home_model->get_data('benh',array('idchuyenkhoa'=>$idchuyenkhoa));
        if($data['chuyenkhoa'] && $data['danhsachbenh']){
            $this->load->view('mod_chuyenkhoa/danhsachbenh',$data);
        }else {
            echo '<div class="danhsachbenh"><h3>Không có bệnh nào thuộc chuyên khoa này</h3></div>';
        }
    }
    function savesession(){
        $idbenh = $this->uri->segment(4);
        //$this->session->set_userdata(array('idbenh'=>$idbenh));
        
        //echo $idbenh;
        //print_r($this->session->all_userdata());
        redirect(base_url().'frontend/index/thongtinbenh');
    }
}